﻿<?xml version="1.0" encoding="utf-8" ?>
<control xmlns:def="Definition" xmlns="http://schemas.sitecore.net/Visual-Studio-Intellisense">
	<DeviceLayoutWizard.AddDevice>
		<Script Src="/sitecore/shell/Applications/Tools/Add%20device%20layout%20wizard/dlw.js" />
		<Stylesheet Src="/sitecore/shell/Applications/Tools/Add%20device%20layout%20wizard/dlw.css"/>

		<WizardForm Application="Tools/AddDeviceLayoutWizard" CodeBeside="FiveLimes.Sitecore.DeviceLayoutWizard.AddDeviceLayoutWizardForm,FiveLimes.Sitecore.DeviceLayoutWizard">

			<WizardFormFirstPage ID="FirstPage" Icon="People/32x32/pda.png">
				<Border Class="scWizardWelcomeTitle">
					<Literal ID="Welcome" Text="Welcome to the Add Device Layout Wizard."/>
				</Border>
				<Literal Text="This wizard helps you:"/>
				<ul>
					<li class="scWizardBullet">
						<Literal Text="Distribute a device layout to existing nodes."/>
					</li>
					<li class="scWizardBullet">
						<Literal Text="Selectively overwrite layouts that may already be defined."/>
					</li>
					<li class="scWizardBullet">
						<Literal Text="Distribute new Device Layouts by Template."/>
					</li>
				</ul>
			</WizardFormFirstPage>

			<WizardFormPage ID="SelectTemplate" Header="Select Device and Template" Text="Select the device a template whose __StandardValues contains the display you would like to distribute to its nodes." Icon="People/32x32/pda.png">
				<WizardFormIndent>
					<DataContext ID="DataContext" Root="{3C1715FE-6A13-4FCF-845F-DE308BA9741D}" filter="@@templateid='{0437FEE2-44C9-46A6-ABE9-28858D9FEE8C}' or @@templateid='{AB86861A-6030-46C5-B394-E8F99E8B87DB}'"/>
					<GridPanel Width="100%" Height="100%">
						<Scrollbox Height="100%" Class="scScrollbox scFixSize scKeepFixSize" Background="white" Border="1px inset" Padding="0" GridPanel.Height="100%">
							<DataTreeview ID="Treeview" DataContext="DataContext" ShowRoot="false" Width="400px">
								<TreeHeader Width="400px">
									<TreeHeaderItem Name="name" Header="Template" Width="400px" />
								</TreeHeader>
							</DataTreeview>
						</Scrollbox>
					</GridPanel>

				</WizardFormIndent>
			</WizardFormPage>

			<WizardFormPage ID="SelectDevice" Header="Select Device" Text="Select the device with the layout that you want to roll out." Icon="People/32x32/pda.png">
				<WizardFormIndent>
					<DataContext ID="DataContextItem" Root="/sitecore/Content" DataViewName="Master"/>
					<GridPanel Width="100%">
						<Literal Text="Only Devices that have layout defined on Standard Values are enabled for selection." />
						<Space GridPanel.Height="20px"/>
						<Literal Text="Device:&#160;" Style="white-space:nowrap;margin-right:0.5em"/>
						<Combobox ID="Devices" Width="100%" Padding="0 0 0 8" GridPanel.Width="60%"/>
						<Space GridPanel.Height="20px"/>
						Check this box if you want to overwrite any existing layout for this device.
						<Space GridPanel.Height="4px"/>
						<Checkbox ID="Overwrite" Header="Overwrite" />
						<Space GridPanel.Height="20px"/>
						Apply layout replacements to nodes that are descendents (or self) of the following:
						<TreePicker ID="ItemRoot" DataContext="DataContextItem" SelectOnly="true" GridPanel.Width="100%" Padding="1"/>
					</GridPanel>
				</WizardFormIndent>
			</WizardFormPage>

			<WizardFormPage ID="SelectNodes" Header="Select Nodes" Text="Select the nodes to apply the layout to." Icon="People/32x32/pda.png">
				<WizardFormIndent>
					<GridPanel Width="100%" Height="100%">
						<Literal Text="{0} items were found for this Template starting at the given root node." ID="SelectNodesMessage" />
						<Space GridPanel.Height="20px"/>
						<Scrollbox Height="100%" Class="scScrollbox scFixSize scKeepFixSize" Background="white" Border="1px inset" Padding="0" GridPanel.Height="100%">
							<Listview ID="AffectedItems" Width="100%" ShowCheckboxes="true" View="List" Click="AddDeviceLayoutWizard:AffectedItemClick">
								<ListviewHeader>
									<ListviewHeaderItem Header="Selected items:"/>
								</ListviewHeader>
							</Listview>
						</Scrollbox>
					</GridPanel>
				</WizardFormIndent>
			</WizardFormPage>

			<WizardFormPage ID="Ready" Header="Ready" Text="Confirm the actions you are about to undertake for undone they cannot [be]." Icon="People/32x32/pda.png">
				<WizardFormIndent>
					<GridPanel Width="100%" Height="100%">
						<Literal Text="The {0} layout from the template's Standard Values will be applied to the following nodes.  Where indicated this will overwrite an existing layout definition." ID="ReadyMessage"/>
						<Space GridPanel.Height="20px"/>
						<Scrollbox Height="100%" Class="scScrollbox scFixSize scKeepFixSize" Background="white" Border="1px inset" Padding="0" GridPanel.Height="100%">
							<Listview ID="ReviewItems" Width="100%" View="Details"  Class="review-items" />
						</Scrollbox>
					</GridPanel>
				</WizardFormIndent>
			</WizardFormPage>
			
			<WizardFormLastPage ID="LastPage" Icon="People/32x32/pda.png">
				<Border ID="SuccessMessage" Padding="0 0 0 20px">
					<Literal Text="The {0} layout has been successfully applied to {1} item(s)." ID="SuccessMessageText" />
				</Border>

				<Border ID="ErrorMessage" Padding="0 0 0 20px" Style="display:none;">
					<Literal Text="The layout update failed for the following reason:" />

					<GridPanel Fixed="true" Style="margin-right:0;width:auto;">
						<Scrollbox Height="100%" Class="scScrollbox scFixSize scKeepFixSize" Padding="0" GridPanel.Height="100%">
							<Border Style="font-weight:bold;word-wrap:break-word;" Padding="1em 2em">
								<Literal ID="ErrorMessageText" />
							</Border>
						</Scrollbox>
					</GridPanel>
				</Border>
			</WizardFormLastPage>

		</WizardForm>

	</DeviceLayoutWizard.AddDevice>
</control>